1. Field of the Invention
This invention relates to an image coding/decoding apparatus (hereinafter, the coding unit is called an encoder, the decoding unit is called a decoder, and the coding/decoding apparatus is called a CODEC).
2. Description of the Related Art
FIG. 1 is a block diagram of a conventional CODEC configured according to an algorithm conforming to image coding/encoding system recommendations H.261 on CCITT (International Telegraph and Telephone Consultative Committee) STUDY GROUP XV-REPORT R 3. In FIG. 1, numeral 1 is input image data, numeral 2 is a coding frame memory, numeral 3 is locally decoded image data of the immediately preceding frame, numeral 4 is motion detection and operation mode decision, numeral 5 is a coding motion vector and coding decision result, numeral 6 is a filter, numeral 7 is filter output data for coding, numeral 8 is interframe subtraction, numeral 9 is coding block image data, numeral 10 is DCT (discrete cosine transform), numeral 11 is zigzag scan conversion, numeral 12 is quantization, numeral 13 is a coding coefficient, numeral 14 is a coding zigzag scan coefficient, numeral 15 is a coding quantization index, numeral 16 is a coding control section, numeral 17 is a transmit buffer, numeral 18 is a transmit buffer parameter, numeral 19 is a coding step size, numeral 20 is VLC (variable length coding) and MUX (multiplex), and numeral 21 is coded compressed data, numeral 22 is transmit data, numeral 23 is inverse quantization, numeral 24 is zigzag scan inversion, numeral 25 is IDCT (inverse discrete cosine transform), numeral 26 is a local decode zigzag scan coefficient, numeral 27 is a local decode coefficient, numeral 28 is local decoding block image data, numeral 29 is locally decoded image data of the immediately preceding frame, numeral 30 is a filter, numeral 31 is filter output data for local decoding, numeral 32 is interframe addition, numeral 33 is locally decoded image data, numeral 34 is receive data, numeral 35 is a receive buffer, numeral 36 is compressed data to be decoded, numeral 37 is VLD (variable length decoding) and DMUX (demultiplex), numeral 38 is decode motion vector and decode decision result, numeral 39 is a decode step size, numeral 40 is a decoding quantization index, numeral 41 is inverse quantization, numeral 42 is zigzag scan inversion, numeral 43 is IDCT, numeral 44 is a decode zigzag scan coefficient, numeral 45 is decode coefficient data, numeral 46 is decoding block image data, numeral 47 is a decoding frame memory, numeral 48 is decoded image data of the immediately preceding frame, numeral 49 is a filter, numeral 50 is filter output data for decoding, numeral 51 is interframe addition, and numeral 52 is decoded image data.
The operation of the conventional CODEC will now be described.
In FIG. 1, image data for 1-frame (for example, 352 horizontal picture elements.times.288 vertical picture elements) is divided into coding/decoding processing blocks (for example, 16 horizontal picture elements.times.16 vertical picture elements) for processing for each block. The encoder performs coding processing and local decoding processing (which is a part of the coding processing, but is distinguished from it in the description of the operation) for each block and the decoder performs decoding processing for each block. The encoder and decoder operate independently of each other.
Coding processing of encoder:
The input image data 1, which is data for each block, and the locally decoded image data of the immediately preceding frame 3, read from the coding frame memory 2, are supplied to the motion detection and operation mode decision 4 which then compares both the image data 1 and the image data 3 for motion detection and operation mode decision. The operation mode decision is to determine which of INTRA (intraframe coding) and INTER (interframe coding) is to be performed and whether the filter 6 is to be turned ON or OFF depending on the comparison result. The function of motion detection is to detect a motion vector indicating motion of the corresponding blocks between frames. The sections of the encoder are controlled in response to the detected coding motion vector and coding decision result 5.
When the operation mode is judged to be INTER, interframe subtraction 8 is performed between the input image data 1 and the filter data for coding 7 provided by passing the locally decoded image data 3 for the corresponding block of the immediately preceding frame whose motion is compensated through the filter 6; when the operation mode is judged to be INTRA, the locally decoded image data of the immediately preceding frame 3 is set to 0, thereby outputting the input image data 1 through the subtractor 8 to provide the coding block image data 9 to be coded.
DCT (discrete cosine transform) 10, zigzag scan conversion 11, and quantization 12 are performed in sequence for the coding block image data to provide the coding coefficient 13, coding zigzag scan coefficient 14, and coding quantization index 15 respectively. The quantization 12 uses the coding step size determined based on transmit buffer parameters 18 such as the generated information amount and remainder of the transmit buffer 17 at the coding control section 16.
The coded compressed data 21 provided by performing VLC (variable length coding) and MUX (multiplex) 20 for the transmit data of the coding motion vector and coding decision result 5, coding quantization index 15, and coding step size 19 is stored in the transmit buffer 17. Then, the transmit data 22 is sent conforming to the line transmission speed (bit rate).
Local decoding processing of encoder:
For interframe coding, the encoder must have the same immediately preceding frame image as the decoder. The data of the immediately preceding frame must also be restored from receive data to perform decoding processing from receive data only at the receiving unit and interframe coding based on the same data must also be performed at the transmitting unit. Thus, the same local decoding processing as the decoder is performed for coded data.
The coding quantization index 15 is subjected to inverse quantization 23 by using the same coding step size 19 as coding, and is further subjected to zigzag scan inversion 24 and IDCT (inverse discrete cosine transform) 25 to provide the local decode zigzag scan coefficient 26, local decode coefficient 27, and local decode block image data 28 respectively.
The local decode image data of the immediately preceding frame 29 is again read from the coding frame memory. Interframe addition 32 is performed between the filter data for local decoding 31 provided by passing the image data 29 through the filter 30 and the local decode block image data 28 and the local decode image data 33 (data restored from the coded data) is written into the coding frame memory 2.
Decoding processing of decoder:
The receive data 34 from the line is stored in the receive buffer 35 is and then read out as the compressed data to be decoded 36 at the timing conforming to decoding processing.
The compressed data to be decoded 36 is subjected to variable length decoding and demultiplexing at the VLD (variable length decoding) and DMUX (demultiplex) 37 to provide the decode motion vector and decode decision result 38, decode step size 39, and decode quantization index 40. The decode motion vector and decode decision result 38 are used to control the sections of the decoder.
The decode quantization index 40 is subjected to inverse quantization 41 by using the decode step size 39 and further subjected to zigzag scan inversion 42 and IDCT 43 to provide the decode zigzag scan coefficient 44, decoding coefficient 45, and decoding block image data 46 respectively.
The decoded image data of the immediately preceding frame 48 is read from the decoding frame memory 47. Interframe addition 51 is performed between the filter data for decoding 50 provided by passing the image data 48 through the filter 49 and the decoding block image data 46. The resultant decoded image data 52 is written into the decoding frame memory 2 and is output as a decoded image at the same time.
The conventional image CODEC has the encoder and decoder which operate independently, and contains a plurality of similar components. This introduces such problems that
(1) the circuit scale is large and expensive;
(2) the gate scale and wiring area are too large to put the circuitry into an LSI and external pins cannot be multiplexed and the number of external pins increases, thus it is difficult to house the circuitry in one chip; and
(3) when a large number of images are coded/decoded at the same time, there is no synchronous relationship to enable multiplex between the images, thus multiplexing cannot be performed and the same number of devices must be provided as the number of images to be processed.